package com.example.demo.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

import java.util.Objects;

/**
 * 功能描述：
 *  角色
 * @Author: Zhanghf
 * @Date: 2021/12/11 14:52
 */
public class Role {
    @TableId(type = IdType.AUTO)
    private Integer id;
    private String rolename;
    private Integer bookid;

    public Role(String rolename, Integer bookid) {
        this.rolename = rolename;
        this.bookid = bookid;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Role)) return false;
        Role role = (Role) o;
        return Objects.equals(rolename, role.rolename) &&
                Objects.equals(bookid, role.bookid);
    }

    @Override
    public int hashCode() {
        return Objects.hash(rolename, bookid);
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getRolename() {
        return rolename;
    }

    public void setRolename(String rolename) {
        this.rolename = rolename;
    }

    public Integer getBookid() {
        return bookid;
    }

    public void setBookid(Integer bookid) {
        this.bookid = bookid;
    }

    public Role() {
    }
}
